﻿using System;
using System.Windows.Data;
using System.Globalization;

namespace Coco.Converters
{
    public class NumberGreaterThanToParameterConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int param = int.Parse(parameter.ToString());
            if ((int)value > param)
            {
                return param;
            }
            else
            {
                return (int)value;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}
